package com.ys.erp.stage_user_service.controller;

import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.ys.erp.entity.data.bean.User;
import com.ys.erp.framework.annotation.CheckEmpLogin;
import com.ys.erp.framework.annotation.RedissonLock;
import com.ys.erp.framework.annotation.ResponseResult;
import com.ys.erp.framework.annotation.StageLoginEmp;
import com.ys.erp.framework.bean.dto.StageEmpDTO;
import com.ys.erp.framework.exception.YsException;
import com.ys.erp.framework.response.PageDTO;
import com.ys.erp.stage_user_service.bean.condition.UserCondition;
import com.ys.erp.stage_user_service.bean.vo.UserVO;
import com.ys.erp.stage_user_service.service.UserService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.Objects;

/**
 * @author lwj
 * @date 2025/5/29
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/manage/user")
@Tag(name = "后台相关接口", description = "后台相关接口")
@ResponseResult
public class UserController {

    private final UserService userService;

    @PostMapping("/pageUser")
    @Operation(summary = "分页用户", description = "分页用户")
    @CheckEmpLogin
    public PageDTO<UserVO> pageUser(@RequestBody @Valid UserCondition.PageUserCon con,
                                    @StageLoginEmp StageEmpDTO empDto) {
        return userService.pageUser(empDto, con);
    }

}
